package com.wk.common;

import java.io.Serializable;

public class ResUtil implements Serializable {

	/** serialVersionUID*/
	private static final long serialVersionUID = -8193641806621387673L;
	public static <T> R<T> getSuccess(String msg){
		return new R<T>(R.SUCCESS,msg);
	}
	public static <T> R<T> getSuccess(String msg,T data){
		return new R<T>(R.SUCCESS,msg,data);
	}
	public static <T> R<T> getSuccess(T data){
		return new R<T>(R.SUCCESS,null,data);
	}
	public static <T> R<T> getSuccessQuery(T data){
		return new R<T>(R.SUCCESS,R.SUCCESS_QUERY,data);
	}
	public static <T> R<T> getSuccessSubmit(T data){
		return new R<T>(R.SUCCESS,R.SUCCESS_SUBMIT,data);
	}
	
	public static <T> R<T> getError(String msg){
		return new R<T>(R.FAIL,msg);
	}
	public static <T> R<T> getError(String msg,T data){
		return new R<T>(R.FAIL,msg,data);
	}
}
